package com.jic.market.service.rest.discount;

import com.jic.market.enums.FrontPromotionTypeEnum;
import com.jic.market.enums.MutuallyExclusiveTypeEnum;
import com.jic.market.impl.rest.discount.model.ConditionDiscountModel;
import com.jic.market.impl.rest.discount.model.DiscountOrderModel;
import com.jic.market.impl.rest.discount.model.GoodsDetailModel;
import com.jic.market.request.rest.discount.DiscountSubOrderRequest;
import com.jic.market.request.rest.discount.PromotionGoods;
import com.jic.market.response.rest.coupon.QueryCouponPersonResponse;

import java.util.List;
import java.util.Map;

/**
 * @author yinhaijun
 * @date: 2020/4/10
 */
public interface DiscountModelService {

    /**
     * 加载单品活动模型
     */
    Map<String, GoodsDetailModel> buildSingle(List<PromotionGoods> promotionGoodsList, FrontPromotionTypeEnum frontPromotionTypeEnum);

    /**
     * 加载除了优惠劵的第二组多品活动模型
     */
    List<ConditionDiscountModel> buildCondition(Map<String, GoodsDetailModel> goodsDetailModelMap, Object request, FrontPromotionTypeEnum frontPromotionTypeEnum);


    /**
     * 加载优惠劵的活动模型，忽略了多品活动
     */
    Map<MutuallyExclusiveTypeEnum, List<ConditionDiscountModel>> buildCoupon(Map<String, GoodsDetailModel> goodsDetailModelMap, List<QueryCouponPersonResponse> couponInfoList);

    /**
     * 保存模型
     */
    void save(DiscountOrderModel discountOrderModel);

    /**
     * 从数据库加载到模型
     */
    DiscountOrderModel load(String orderNo);

    /**
     * 构建模型
     */
    DiscountOrderModel buildDiscountOrderModel(DiscountSubOrderRequest discountSubOrderRequest);
}
